home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
tpapi.exe
/
NWSYNCH.PA1
< prev
next >
Wrap
Text File
|
1994-01-14
|
8KB
|
186 lines
{#Z+}
(*(10U&l12D(s4099T&k2S*)
{***************************************************************************}
{** Program : NWSYNCH **}
{***************************************************************************}
{** Version : 1.53 ** Started : 11/11/91 ** Ended : / / **}
{***************************************************************************}
{******************************** Description ******************************}
{***************************************************************************}
{** OOP library for Netware API **}
{** **}
{** This unit forms the second level object : SYNCHRONISATION **}
{** This object is a descandent of : NETWARE **}
{** **}
{** **}
{** **}
{** **}
{***************************************************************************}
{******************************** Information ******************************}
{***************************************************************************}
{** Provides Netware Synchronisation Services **}
{** **}
{** **}
{** **}
{** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED. **}
{** Portions (c) Novell Inc, **}
{** **}
{** **}
{***************************************************************************}
{$I NETWARE.INC}
{#Z-}
UNIT NWSYNCH;
INTERFACE
USES
nwvar,
netware;
TYPE
PSynchronisationOBJ = ^SynchronisationOBJ;
SynchronisationOBJ = OBJECT (NetwareOBJ)
{ This object provides Netware Synchronisation Services API's. }
FUNCTION ClearFile (DirectoryHandle : byte; FileName : TPathName) : WORD;
{ Clear a file from the client's logged files table. If the file is open it
is closed. }
{#F}
{}
{ DirectoryHandle: Directory handle pointing to a directory/volume. If
specifying a full path then should be 0. }
{ FileName : Path where the file resides. Must include the
filename. If DirectoryHandle is 0 then FileName must include
the volume name. eg. SYS1:\USERS\TONY\TEST.PRT. }
{#F}
function ClearFileSet (LockFlag : byte) : word;
{ Clears all files from the client's logged files table. All open files are
closed. }
{#F}
{ LockFlag: }
{#F}
FUNCTION ClearLogicalRecord (LogicalRecordName : TLogicalRecordName) : WORD;
{ Clears the specified name from the client's table. The name cannot be
reused until it is relogged. Any locks associated with the name are
cleared. }
{#F}
{}
{ LogicalRecordName: contains the name to clear from the client's table. }
{#F}
function ClearLogicalRecordSet (LockFlag : byte) : word;
{ Clears all names from the client's table.
{#F}
{}
{ LockFlag: }
{#F}
{#X ClearLogicalRecord#}
FUNCTION ClearPhysicalRecord (FileHandle : WORD; RecordOffset,
RecordLength : LONGINT) : WORD;
{ Removes the specified byte range from the client's lock table. A portion
of an existing lock cannot be cleared. }
{#F}
{}
{ FileHandle : handle of the file that has a physical record lock. }
{ RecordOffset: starting position within the file where the lock starts. }
{ RecordLength: length of the byte range locked. }
{#F}
function ClearPhysicalRecordSet (LockFlag : byte) : word;
{ Removes all physical records in a log table and removes them from the log
table. }
{#F}
{}
{ LockFlag: }
{#F}
FUNCTION CloseSemaphore (SemaphoreHandle : LONGINT) : WORD;
{ Closes the specified Semaphore and decreases the OpenCount value by 1. }
{#F}
{}
{ SemaphoreHandle: handle of the semaphore to be closed. Obtained when
calling #OpenSemaphore#. }
{#F}
FUNCTION ExamineSemaphore (SemaphoreHandle : LONGINT;
VAR SemaphoreValue : integer;
var OpenCount : BYTE) : WORD;
{ Allows a client to determine the value of a semaphore. }
{#F}
{}
{ SemaphoreValue: contains the current value of the semaphore. }
{ OpenCount : contains the number of clients that have the semaphore
open. }
{#F}
{#X WaitOnSemaphore SignalSemaphore }
FUNCTION GetLockMode : WORD;
{ Returns the current locking mode. An application should set the lock mode
to $01 for all Netware v4.61 and later. Lock mode should be set to $00 for
versions prior to v4.61. The default lock mode is $00. }
FUNCTION LockFileSet (TimeOut : WORD) : WORD;
{ Attempts to lock all files logged in a log table. }
{#F}
{}
{ TimeOut: Determines how long the function will attempt to lock the files.
Values are measured in ticks (1/18). A value of 0 means NO WAIT. }
{#F}
FUNCTION LockLogicalRecordSet (LockDirective : BYTE; Timeout : WORD) : WORD;
{ Attempts to lock all logical records logged in a log table. }
{#F}
{}
{ LockDirective: if $00 lock with exclusive lock. }
{ if $01 lock with shareable lock. }
{#F}
{ TimeOut : Determines how long the function will attempt to lock the
files. Values are measured in ticks (1/18). A value of 0 means
NO WAIT. }
FUNCTION LockPhysicalRecordSet (LockDirective : BYTE; TimeOut : WORD) : WORD;
FUNCTION LogFile (FileName : TPathName; LockDirective : BYTE; TimeOut : WORD) : WORD;
FUNCTION LogLogicalRecord (LogicalRecordName : TLogicalRecordName;
LockDirective : BYTE; TimeOut : WORD) : WORD;
FUNCTION LogPhysicalRecord (FileHandle : WORD; RecordOffSet, RecordLength : LONGINT;
LockDirective : BYTE; TimeOut : WORD) : WORD;
FUNCTION OpenSemaphore (SemaphoreName : TSemaphoreName; InitialValue : integer;
VAR SemaphoreHandle : LONGINT; VAR OpenCount : BYTE) : WORD;
FUNCTION ReleaseFile (DirectoryHandle : byte; FileName : TPathName) : WORD;
function ReleaseFileSet (LockFlag : byte) : word;
FUNCTION ReleaseLogicalRecord (LogicalRecordName : TLogicalRecordName) : WORD;
function ReleaseLogicalRecordSet (LockFlag : byte) : word;
FUNCTION ReleasePhysicalRecord (FileHandle : WORD; RecordOffset, RecordLength : LONGINT) : WORD;
function ReleasePhysicalRecordSet (LockFlag : byte) : word;
FUNCTION SetLockMode (LockMode : BYTE) : WORD;
FUNCTION SignalSemaphore (SemaphoreHandle : LONGINT) : WORD;
FUNCTION WaitOnSemaphore (SemaphoreHandle : LONGINT; TimeOut : WORD) : WORD;
DESTRUCTOR Done; VIRTUAL;
END;
{#Z+}